Backport "Expr#show: Don't crash when the expression contains an unsupported type (like a SkolemType)" to LTS#9
Merged
WojciechMazur merged 1 commit intolts-3.3from Dec 6, 2024
Conversation
…pe (like a SkolemType)
When the SkolemType appears as the prefix of a TypeRef, we avoid it by going
using `qualifier` which is defined in QuotesImpl to widen skolem, but skolems
can appear in any position, and so before this change we would get a compiler
crash in the added test case where the skolem appears as the prefix of a
TermRef.
We fix this by adding fallback cases in the quotes pretty-printer, now for the
test case we get:
Test.f.ho(((arg: <<SkolemType(693709097) does not have a corresponding extractor> does not have a source representation>.x.type) => arg))
Which isn't great, but better than a crash.
Maybe we should run `Type#deskolemized` on a type before trying to print it in
SourceCode/Extractors, but currently these files are intentionally defined to
not depend on compiler internals and do not have a `Context` so we cannot even
call `deskolemized` on them.
Alternatively, maybe SkolemType should be a tasty-reflect constructor but that
would also be a pretty big change.
[Cherry-picked 0ee8762][modified]
Author
|
No regressions detected in the community build up to backport-lts-3.3-22148. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports scala#20494 to the 3.3.5.
PR submitted by the release tooling.
[skip ci]